package org.jeecg.modules.paycenter.service;

import org.jeecg.modules.paycenter.dto.BankCfgDto;
import org.jeecg.modules.paycenter.enums.PayChannelEnum;
import org.jeecg.modules.wlhy.hyconfig.entity.HyConfig;
import org.jeecg.modules.wlhy.utils.HyCfgUtil;
import org.jeecg.modules.wlhy.utils.HyConfigUtils;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class PayCenterService {

    public List<BankCfgDto> getPtAccountCfgList() {
        List<BankCfgDto> list = new ArrayList<>();
        HyConfig config = HyConfigUtils.getConfig();
        if(config.getNhbankIzUse()){
            list.add(new BankCfgDto("农行", PayChannelEnum.NH.channelType));
        }
        if(config.getPfIzUse()){
            list.add(new BankCfgDto("浦发", PayChannelEnum.PF.channelType));
        }
        if(HyCfgUtil.isTongLianUsed()){
            list.add(new BankCfgDto("通联", PayChannelEnum.TONGLIAN.channelType));
        }
        if(HyCfgUtil.isUsed2("hundsun")){
            list.add(new BankCfgDto("徽商", PayChannelEnum.HUNDSUN.channelType));
        }
        return list;
    }
}
